//
//  BFOpacityNode.m
//  BattleFrontier
//
//  Created by erichyb on 11/2/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "BBOpacityNode.h"


@implementation BBOpacityNode
@synthesize opacity=_opacity;
-(id)init{
    if (self=[super init]) {
        _opacity = 255;
    }
    return self;
}
-(void)setOpacity:(GLubyte)op{
    _opacity = op;
	CCArray *children = [self children];
	for (NSInteger i=0, n=[children count]; i<n; i++) {
		CCSprite* child = [children objectAtIndex:i];
		[child setOpacity:op];
	}
}
@end

@implementation BBOpacitySprite
@synthesize opacity=_opacity;
-(id)init{
    if (self=[super init]) {
        _opacity = 255;
    }
    return self;
}
-(void)setOpacity:(GLubyte)op{
    _opacity = op;
	CCArray *children = [self children];
	for (NSInteger i=0, n=[children count]; i<n; i++) {
		CCSprite* child = [children objectAtIndex:i];
		[child setOpacity:op];
	}
}
@end